.\" Copyright 1998-2002 Riley H. Williams <Riley@Williams.Name>.
.\" May be distributed under the GNU General Public License.
.
.TH KNL 8 "10 June 2002" "Linux 2.0" "Linux Programmer's Manual"
.
.SH NAME
knl \- query/set kernel configuration parameters
.
.SH SYNOPSIS
.TP
.B knl
.B [--kernel=]image
.B [-f=flaglist]
.B [--flags=flaglist]
.B [--noram]
.B [-p]
.B [--prompt]
.B [--ram=offset]
.B [-r=device]
.B [--root=device]
.B [-v=mode]
.B [--video=mode]
.B [--help]
.B [--version]
.
.SH OPTIONS
.TP
.B [--kernel=]image
Selects the kernel image file of interest.
.TP
.B -f=flaglist --flags=flaglist
Specifies the kernel flags to be set. Currently, only
.B RO
is implemented, which specifies that the root file system is to be mounted
.B read-only
by default. However, for compatibility with future additions, flags of the
format
.B Xn
are also accepted, where
.B n
is in the range from
.B 0
to
.B 15
inclusive, and these will set the appropriate flag.
.TP
.B \ 
An option of
.B None
is also implemented to indicate that no flags should be set, but if used,
the
.B None
option must be the only option specified.
.TP
.B --help\ \ \ \ 
Displays a help screen, then exits.
.TP
.B --noram\ \ \ 
Specifies that no ramdisk should be created by default.
.TP
.B \ 
This option is incompatible with the
.B --prompt
and
.B --ram
parameters.
.TP
.B -p --prompt
Specifies that a ramdisk should be created by default, and that the
kernel should prompt for the relevant disk before loading the ramdisk
image from disk.
.TP
.B \ 
This option is incompatible with the
.B --noram
option.
.TP
.B --ram=offset
Specifies that a ramdisk should be created by default, and the offset in
the disk to the start of the ramdisk image. This offset may not exceed
.B 8191
blocks.
.TP
.B \ 
This option is incompatible with the
.B --noram
option.
.TP
.B -r=device --root=device
Specifies the default device to mount as the file system root. The device
can be specified as described in the
.I DEVICES
section (below), or can be specified as
.B NFS
to indicate that the file system root is remote NFS mounted.
.TP
.B --version
Displays the program version, then exits.
.TP
.B -v=mode --video=mode
Specifies the default video mode. See the
.I VIDEO MODES
section (below) for further details.
.
.SH DESCRIPTION
In a bootable image for the
.B Linux
kernel, there are several pairs of bytes which specify various kernel
options, located at the following offsets:
.nf
.RS

 498  1F2  Root flags
 500  1F4  Reserved
 502  1F6  Unused (was Swap Device)
 504  1F8  RAM Disk Parameters
 506  1FA  VGA Mode
 508  1FC  Root Device
 510  1FE  Boot Signature

.RE
.fi
.B knl
will change or display these values.
.
.SH DEVICES
Valid values for the
.B device
specification in the
.B --root
options are as follows:
.PP
.nf
.RS

/dev/aztcd       /dev/aztcd[1-255]
/dev/bd[ab]      /dev/bd[ab][1-4]        (ELKS)
                 /dev/cdouble[0-127]
                 /dev/double[0-127]
                 /dev/fd[0-3]
/dev/flash       /dev/flash[1-7]
/dev/gscd        /dev/gscd[1-255]
/dev/hd[a-h]     /dev/hd[a-h][1-63]
/dev/hitcd       /dev/hitcd[1-255]
/dev/mcd         /dev/mcd[1-255]
/dev/optcd       /dev/optcd[1-255]
/dev/ram         /dev/ram[0-7]
/dev/rflash      /dev/rflash[1-7]
/dev/rom         /dev/rom[1-7]
/dev/rrom        /dev/rrom[1-7]
/dev/scd         /dev/scd[1-255]
/dev/sd[a-g]     /dev/sd[a-g][1-15]
/dev/sjcd        /dev/sjcd[1-255]
/dev/sonycd      /dev/sonycd[1-255]
/dev/xda         /dev/xda[1-63]
/dev/xdb         /dev/xdb[1-63]

.RE
.fi
.PP
In addition to the options listed above,
.B /dev/ramdisc
and
.B /dev/ramdisk
are synonyms for
.B /dev/ram0
and, additionally,
.B Boot
can be used to specify the boot device, and
.B NFS
can be used to specify that the root device is on the Network File System
(NFS). The
.B /dev/
part is optional in each case (but must
.B NOT
be prefixed to the
.B Boot
or
.B NFS
options).
.PP
In addition to the above, a general method of specifying
.B ANY
block device by its major and minor numbers has been implemented. To
specify a device that is not specifically supported (or indeed one that
is supported, if it comes to that), specify
.B Mode-X.Y
where X is the relevant
.B major
number, and Y is the appropriate
.B minor
number.
.
.SH KERNEL IMAGE SELECTION
Typical values for the
.B --kernel
option, which specifies a bootable Linux kernel image, are as follows:
.PP
.nf
.RS

/boot/vmlinuz
/boot/vmlinuz.test
/vmlinux
/vmlinux.test
/vmunix
/vmunix.test
/dev/fd0
/dev/fd1

.RE
.fi
.PP
Any other file on the disk can be specified and, providing it satisfies
the (admittedly rather basic) criteria for being a kernel image file, it
will be accepted as such. 
.
.SH VIDEO MODES
Valid values for the
.B --video
option are as follows:
.nf
.RS

Ask  = Prompt for the video mode to use
EVGA = Extended VGA (80x50)
VGA  = Standard VGA (80x25)

  0  = Mode selected by choosing '0' at the prompt.
  1  = Mode selected by choosing '1' at the prompt.
  2  = Mode selected by choosing '2' at the prompt.
  n  = Mode selected by choosing 'n' at the prompt.

.RE
.fi
Valid numeric arguments are in the range from
.B 0
to
.B 65499
inclusive, as supported by the video hardware in the system in question.
.
.SH ERRORS
The following errorlevels may be reported:
.PP
.TP
\  \  0
Successful completion of task.
.TP
\  \  1
Kernel image file not specified.
.TP
\  \  2
Kernel image file not found.
.TP
\  \  3
Specified file is not a kernel image.
.TP
\  \  4
Kernel image file can't be updated.
.TP
\  \  5
Kernel image file not updated correctly.
.TP
\  255
.B --help
or
.B --version
specified.
.
.SH WHEN USING LILO
If
.B LILO
is used,
.B knl
is no longer needed for setting the root device and the video mode
since these parameters that
.B knl
modifies can be set from the
.B LILO
prompt during a boot. However,
.B knl
is still needed at this time for setting the RAM disk parameters.
Users are encouraged to find the
.B LILO
documentation for more information, and to use
.B LILO
when booting their systems.
.
.SH AUTHORS
The
.B knl
program and documentation was written by Riley Williams
<Riley@Williams.Name>. It was inspired by the
.B rdev
program and documentation originally written by Werner Almesberger
<almesber@nessie.cs.id.ethz.ch>, and modified by Peter MacDonald
<pmacdona@SanJuan.UVic.ca>, with root flags support added by Stephen
C. Tweedie <sct@dcs.ed.ac.uk>.
